package com.hczt.xhminiapp.adminapi.modules.system.controller;

import com.hczt.xhminiapp.adminapi.modules.system.service.DictService;
import com.hczt.xhminiapp.common.bean.RtnResult;
import com.hczt.xhminiapp.db.entity.Dict;
import com.hczt.xhminiapp.db.entity.SysPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 红创-马海强
 * @date 2019-03-13 15:51
 * @description
 */
@RestController
@RequestMapping("/dicts")
public class DictController {

    @Autowired
    private DictService dictService;

    /**
     * 获取树结构
     * @return
     */
    @GetMapping("/tree")
    public Object tree(){
        List<Dict> tree = dictService.findDictTree();
        return RtnResult.success(tree);
    }
}
